<!DOCTYPE html>
<html style="background-color: #e2e2e2;">
<head>
    <meta charset="utf-8">
    {#  <meta name="keywords" content="{{ lay.base.keywords }}">#}
    {#  <meta name="description" content="{{ lay.base.description }}">#}
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="shortcut icon" href="{{ static('images/logo.ico') }}"/>
    <meta name="keywords" content="小宅社区">
    <meta name="description" content="小宅社区">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>发现 2019 年度最佳案例</title>
    <link rel="stylesheet" href={{ static('js/layui/css/layui.css') }}>
    {#  <link rel="stylesheet" href="../res/css/global.css">#}
    <link rel="stylesheet" href={{ static('css/global.css') }}>
    <style>
        .header {
            border-bottom: 1px solid #404553;
            border-right: 1px solid #404553;
        }
    </style>
</head>
<body class="fly-full">
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
<div class="fly-header layui-bg-black">
    <div class="layui-container">
        <a class="fly-logo" href="/">
            {#            <img src="../res/images/logo.png" alt="layui">#}
            <img src={{ static('images/logo.png') }} alt="layui">
        </a>
        <ul class="layui-nav fly-nav layui-hide-xs">
            <li class="layui-nav-item layui-this">
                <a href="/"><i class="iconfont icon-jiaoliu"></i>交流</a>
            </li>
            <li class="layui-nav-item">
                <a href="case/case"><i class="iconfont icon-iconmingxinganli"></i>案例</a>
            </li>
        </ul>

        <ul class="layui-nav fly-nav-user">
            {% if user.username %}
                <li class="layui-nav-item">
                    <a class="fly-nav-avatar" href="/user/index">
                        <cite class="layui-hide-xs">{{ user.username }}</cite>
                        <i class="iconfont icon-renzheng layui-hide-xs" title="认证信息：layui 作者"></i>
                        <i class="layui-badge fly-badge-vip layui-hide-xs">VIP{{ user.is_vip }}</i>
                        <img src="{{ user.images_url }}">
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="/user/set"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
                        <dd><a href="/user/message"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a>
                        </dd>
                        <dd><a href="/user/home?u={{ user.id }}"><i class="layui-icon"
                                                                    style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a>
                        </dd>
                        <hr style="margin: 5px 0;">
                        <dd><a href="/logout" style="text-align: center;">退出</a></dd>
                    </dl>
                </li>
            {% else %}
                <li class="layui-nav-item">
                    <a class="iconfont icon-touxiang layui-hide-xs" href="user/login"></a>
                </li>
                <li class="layui-nav-item">
                    <a href="/login">登入</a>
                </li>
                <li class="layui-nav-item">
                    <a href="/reg">注册</a>
                </li>


            {% endif %}
        </ul>
    </div>
</div>

<div class="fly-case-header">
    <p class="fly-case-year">2019</p>

    <img class="fly-case-banner" src="{{ static('res/images/case.png') }}" alt="发现 Layui 年度最佳案例">

    <div class="fly-case-btn">
        <a href="javascript:;" class="layui-btn layui-btn-big fly-case-active" data-type="push">提交案例</a>
        <a href="/user/home?u={{ user.id }}" class="layui-btn layui-btn-primary layui-btn-big">我的案例</a>

        <a href="/jie/detail?u=1264" target="_blank" style="padding: 0 15px; text-decoration: underline">案例要求</a>
    </div>
</div>

<div class="fly-main" style="overflow: hidden;">


    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            {% if sort == 'newest' %}
                <li class="layui-this"><a href="/case/case?sort=newest">按提交时间</a></li>
                <li><a href="/case/case?sort=heated">按点赞排行</a></li>

            {% elif sort == 'heated' %}
                <li><a href="/case/case?sort=newest">按提交时间</a></li>
                <li class="layui-this"><a href="/case/case?sort=heated">按点赞排行</a></li>
            {% endif %}
            {#            <li class="layui-this"><a href="">按提交时间</a></li>#}
            {#            <li><a href="">按点赞排行</a></li>#}
        </ul>
    </div>

    <ul class="fly-case-list">
        {% for sku in page_skus %}
            <li data-id="123">
                <a class="fly-case-img" href="{{ sku.case_url }}" target="_blank">
                    <img src="{{ sku.case }}" alt="Fly社区">
                    <cite class="layui-btn layui-btn-primary layui-btn-small">去围观</cite>
                </a>
                <h2><a href="{{ sku.case_url }}" target="_blank">{{ sku.title }}</a></h2>
                <p class="fly-case-desc">{{ sku.content }}</p>
                <div class="fly-case-info">
                    <a href="/user/home?u={{ sku.user.id }}" class="fly-case-user" target="_blank"><img
                            src="{{ sku.user.images_url }}"></a>
                    <p class="layui-elip" style="font-size: 12px;"><span
                            style="color: #666;">{{ sku.user.username }}</span> {{ sku.create_time.strftime("%Y-%m-%d") }}
                    </p>
                    <p>获得<a class="fly-case-nums fly-case-active" href="javascript:;" data-type="showPraise"
                            style=" padding:0 5px; color: #01AAED;">{{ sku.click_nums }}</a>个赞</p>
                    <button class="layui-btn layui-btn-primary fly-case-active" data-type="praise">点赞</button>
                    <!-- <button class="layui-btn  fly-case-active" data-type="praise">已赞</button> -->
                </div>
            </li>
        {% endfor %}
    </ul>

    <!-- <blockquote class="layui-elem-quote layui-quote-nm">暂无数据</blockquote> -->

    <div style="text-align: center">
        <div style="border-top: 1px dotted #e2e2e2; text-align: center;">

            <div class="laypage-main">
                {% if num == 1 %}

                    {% if page_num > 1 %}
                        <a href="?page=1" class="laypage-last" title="首页">首页</a>
                        <a href="?page={{ page_num - 1 }}" class="laypage-prev">上一页</a>
                    {% endif %}
                    {% if page_num - 3 > 1 %}
                        <span>…</span>
                    {% endif %}
                    {% if page_num > 1 %}
                        {% if page_num - 1 <= total_page %}
                            <a href="?page={{ page_num - 1 }}">{{ page_num - 1 }}</a>
                        {% endif %}
                    {% endif %}
                    <span class="laypage-curr">{{ page_num }}</span>
                    {% if page_num + 1 <= total_page %}
                        <a href="?page={{ page_num + 1 }}">{{ page_num + 1 }}</a>
                    {% endif %}
                    {% if page_num + 2 <= total_page %}
                        <a href="?page={{ page_num + 2 }}">{{ page_num + 2 }}</a>
                    {% endif %}
                    {% if page_num + 3 <= total_page - 1 %}
                        <span>…</span>
                    {% endif %}

                    {% if page_num < total_page %}
                        <a href="?page={{ total_page }}" class="laypage-last" title="尾页">尾页</a>
                        <a href="?page={{ page_num + 1 }}" class="laypage-next">下一页</a>
                    {% endif %}


                {% elif num == "tl" %}
                    {% if page_num > 1 %}}
                        <a href="?sort=heated&page=1" class="laypage-last" title="首页">首页</a>
                        <a href="?sort=heated&page={{ page_num - 1 }}" class="laypage-prev">上一页</a>
                    {% endif %}
                    {% if page_num - 3 > 1 %}
                        <span>…</span>
                    {% endif %}
                    {% if page_num > 1 %}
                        {% if page_num - 1 <= total_page %}
                            <a href="?sort=heated&page={{ page_num - 1 }}">{{ page_num - 1 }}</a>
                        {% endif %}
                    {% endif %}
                    <span class="laypage-curr">{{ page_num }}</span>
                    {% if page_num + 1 <= total_page %}
                        <a href="?sort=heated&page={{ page_num + 1 }}">{{ page_num + 1 }}</a>
                    {% endif %}
                    {% if page_num + 2 <= total_page %}
                        <a href="?sort=heated&page={{ page_num + 2 }}">{{ page_num + 2 }}</a>
                    {% endif %}
                    {% if page_num + 3 <= total_page - 1 %}
                        <span>…</span>
                    {% endif %}

                    {% if page_num < total_page %}
                        <a href="?sort=heated&page={{ total_page }}" class="laypage-last" title="尾页">尾页</a>
                        <a href="?sort=heated&page={{ page_num + 1 }}" class="laypage-next">下一页</a>
                    {% endif %}
                {% endif %}
            </div>
        </div>

    </div>
</div>

<div class="fly-footer">
    <p><a href="#">小宅论坛</a> 2019 &copy; <a href="#">小宅娱乐出品</a>皖ICP备19010957号-1</p>

</div>

<script src={{ static('js/layui/layui.js') }}></script>
<script>
    layui.cache.page = 'case';
    layui.cache.user = {
        username: '游客'
        , uid: -1
        , avatar: '../res/images/avatar/00.jpg'
        , experience: 83
        , sex: '男'
    };
    layui.config({
        version: "3.0.0"
        , base: '../static/res/mods/' //这里实际使用时，建议改成绝对路径
    }).extend({
        fly: 'index'
    }).use('fly');
</script>
</body>
</html>
